#include "searcher.hpp"
#include <cstdio>
#include <cstring>
const std::string input = "data/raw_html/raw.txt";

int main()
{
    std::string query;
    Searcher::searcher* sc = new Searcher::searcher();
    sc->InitSearcher(input);
    char buffer[1024];
    while(true)
    {
        std::string json_string;
        std::cout << "please input your query# ";
        fgets(buffer, 1023, stdin);
        buffer[strlen(buffer)-1] = 0;
        query = buffer;
        sc->search(query, &json_string);
        std::cout << json_string << std::endl;
    }
    
    return 0;
}